package groovy

import groovy.text.GStringTemplateEngine
import groovy.text.Template

def String make(Template template, Map<String, Object> binding)  {
    def param = [:]
    TemplateFunctionFacade fn = new TemplateFunctionFacade();
    param.putAll(fn.functionMap)
    param.put("fn",fn)
    param.putAll(binding)
    return template.make(param).toString()
}

def Template createTemplate(String jsonTemplate){
    GStringTemplateEngine engine = new GStringTemplateEngine();
    return engine.createTemplate(jsonTemplate);
}